<?php

use yii\db\Migration;

class m210326_024756_diandi_store extends Migration
{
    public function up()
    {
        /* 取消外键约束 */
        $this->execute('SET foreign_key_checks = 0');
        
        /* 创建表 */
        $this->createTable('{{%diandi_store}}', [
            'store_id' => "int(11) NOT NULL AUTO_INCREMENT COMMENT '商户id'",
            'category_id' => "int(11) NOT NULL",
            'category_pid' => "int(11) NOT NULL",
            'name' => "varchar(255) NULL COMMENT '门店名称'",
            'logo' => "varchar(255) NULL",
            'bloc_id' => "int(11) NULL COMMENT '关联公司'",
            'province' => "varchar(10) NULL COMMENT '省份'",
            'city' => "varchar(10) NULL COMMENT '城市'",
            'address' => "varchar(255) NULL COMMENT '详细地址'",
            'county' => "varchar(10) NULL COMMENT '区县'",
            'mobile' => "varchar(11) NULL COMMENT '联系电话'",
            'create_time' => "varchar(30) NULL",
            'update_time' => "varchar(30) NULL",
            'status' => "int(10) NULL DEFAULT '0' COMMENT '0:待审核,1:已通过,3:已拉黑'",
            'lng_lat' => "varchar(100) NULL COMMENT '经纬度'",
            'extra' => "text NULL COMMENT '商户扩展字段'",
            'longitude' => "varchar(255) NOT NULL",
            'latitude' => "varchar(255) NOT NULL",
            'PRIMARY KEY (`store_id`)'
        ], "ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT");
        
        /* 索引设置 */
        
        
        /* 表数据 */
        $this->insert('{{%diandi_store}}',['store_id'=>'48','category_id'=>'0','category_pid'=>'5','name'=>'都唻团','logo'=>'202012/11/3c59f947-5ea8-3405-9f4a-e9627a494e82.jpg','bloc_id'=>'8','province'=>'1','city'=>'2','address'=>'北京市海淀区东北旺西路8号中关村软件园','county'=>'8','mobile'=>'17778984690','create_time'=>NULL,'update_time'=>NULL,'status'=>'1','lng_lat'=>'{\"lng\":\"116.300624\",\"lat\":\"40.058667\"}','extra'=>'a:23:{s:5:"intro";s:0:"";s:7:"service";s:0:"";s:9:"hotSearch";s:46:"新品,笔记本,台式机,打印机,卫道士";s:6:"notice";s:0:"";s:3:"des";s:0:"";s:12:"surroundings";s:0:"";s:11:"certificate";s:0:"";s:12:"contact_type";s:0:"";s:9:"send_type";a:1:{i:0;s:1:"0";}s:8:"distance";s:0:"";s:13:"startingPrice";s:1:"0";s:12:"shippingDees";s:1:"0";s:8:"Lodop_ip";s:0:"";s:4:"USER";s:0:"";s:4:"UKEY";s:0:"";s:2:"SN";s:0:"";s:8:"printNum";s:0:"";s:8:"douradio";s:3:"0.4";s:10:"moneyradio";s:3:"0.4";s:8:"agemoney";s:1:"0";s:8:"shareimg";s:50:"202011/23/42cc5fc5-9edd-3599-bfcc-e3d77fc597f3.jpg";s:10:"myshareimg";s:0:"";s:7:"onecode";s:2:"17";}','longitude'=>'116.300624','latitude'=>'40.058667']);
        $this->insert('{{%diandi_store}}',['store_id'=>'49','category_id'=>'6','category_pid'=>'5','name'=>'齐享创客','logo'=>'202103/11/b1da182e-c266-39cd-a0e7-af0c49e3b882.png','bloc_id'=>'10','province'=>'2898','city'=>'2899','address'=>'陕西省西安市雁塔区崇业路23号','county'=>'2905','mobile'=>'13772145451','create_time'=>NULL,'update_time'=>NULL,'status'=>'1','lng_lat'=>'{\"lng\":\"108.941741\",\"lat\":\"34.234047\"}','extra'=>'a:23:{s:5:"intro";s:0:"";s:7:"service";s:0:"";s:9:"hotSearch";s:0:"";s:6:"notice";s:0:"";s:3:"des";s:0:"";s:12:"surroundings";s:0:"";s:11:"certificate";s:0:"";s:12:"contact_type";s:0:"";s:9:"send_type";s:0:"";s:8:"distance";s:0:"";s:13:"startingPrice";s:0:"";s:12:"shippingDees";s:0:"";s:8:"Lodop_ip";s:0:"";s:4:"USER";s:0:"";s:4:"UKEY";s:0:"";s:2:"SN";s:0:"";s:8:"printNum";s:0:"";s:8:"douradio";s:3:"0.4";s:10:"moneyradio";s:3:"0.4";s:8:"agemoney";s:0:"";s:8:"shareimg";s:50:"202012/11/a9a45aec-e219-3b29-9e5e-df6ef5699985.jpg";s:10:"myshareimg";s:0:"";s:7:"onecode";s:0:"";}','longitude'=>'108.941741','latitude'=>'34.234047']);
        $this->insert('{{%diandi_store}}',['store_id'=>'51','category_id'=>'7','category_pid'=>'5','name'=>'易酒批零崇业路店','logo'=>'202012/06/9d8e2cf9-2680-3201-a291-696bfe5f7f6f.jpg','bloc_id'=>'8','province'=>'2898','city'=>'2899','address'=>'陕西省西安市雁塔区崇业路崇业路丰泰大厦南门 对面易酒批零','county'=>'2905','mobile'=>'029-2147483','create_time'=>NULL,'update_time'=>NULL,'status'=>'1','lng_lat'=>'{\"lng\":\"108.941471\",\"lat\":\"34.233289\"}','extra'=>'a:23:{s:5:"intro";s:0:"";s:7:"service";s:0:"";s:9:"hotSearch";s:0:"";s:6:"notice";s:0:"";s:3:"des";s:0:"";s:12:"surroundings";s:0:"";s:11:"certificate";s:0:"";s:12:"contact_type";s:0:"";s:9:"send_type";a:1:{i:0;s:1:"1";}s:8:"distance";s:0:"";s:13:"startingPrice";s:0:"";s:12:"shippingDees";s:0:"";s:8:"Lodop_ip";s:0:"";s:4:"USER";s:0:"";s:4:"UKEY";s:0:"";s:2:"SN";s:0:"";s:8:"printNum";s:0:"";s:8:"douradio";s:3:"0.4";s:10:"moneyradio";s:3:"0.4";s:8:"agemoney";s:0:"";s:8:"shareimg";s:50:"202012/11/918711a6-b5a7-30fb-b3c4-d016df08bc4a.jpg";s:10:"myshareimg";s:0:"";s:7:"onecode";s:0:"";}','longitude'=>'108.941471','latitude'=>'34.233289']);
        $this->insert('{{%diandi_store}}',['store_id'=>'53','category_id'=>'39','category_pid'=>'35','name'=>'美年大健康体检中心（科技路店）','logo'=>'202103/11/2927c930-9798-3c97-941c-95b45dbe5b3b.png','bloc_id'=>'11','province'=>'2898','city'=>'2899','address'=>'陕西省西安市雁塔区科创路168号高新茶城2楼','county'=>'2905','mobile'=>'15771712861','create_time'=>NULL,'update_time'=>NULL,'status'=>'1','lng_lat'=>'{\"lng\":\"108.914411\",\"lat\":\"34.230841\"}','extra'=>'a:23:{s:5:"intro";s:0:"";s:7:"service";s:0:"";s:9:"hotSearch";s:0:"";s:6:"notice";s:0:"";s:3:"des";s:0:"";s:12:"surroundings";s:0:"";s:11:"certificate";s:0:"";s:12:"contact_type";s:0:"";s:9:"send_type";s:0:"";s:8:"distance";s:0:"";s:13:"startingPrice";s:0:"";s:12:"shippingDees";s:0:"";s:8:"Lodop_ip";s:0:"";s:4:"USER";s:0:"";s:4:"UKEY";s:0:"";s:2:"SN";s:0:"";s:8:"printNum";s:0:"";s:8:"douradio";s:3:"0.4";s:10:"moneyradio";s:3:"0.4";s:8:"agemoney";s:0:"";s:8:"shareimg";s:0:"";s:10:"myshareimg";s:0:"";s:7:"onecode";s:0:"";}','longitude'=>'108.914411','latitude'=>'34.230841']);
        $this->insert('{{%diandi_store}}',['store_id'=>'54','category_id'=>'39','category_pid'=>'35','name'=>'美年大健康体检中心（大雁塔店）','logo'=>'202103/11/2e7f1841-4c5b-3b3b-8d64-53e1d4cff23e.png','bloc_id'=>'11','province'=>'2898','city'=>'2899','address'=>'陕西省西安市雁塔区慈恩西路66号(威斯汀酒店西楼)美年大健康(大雁塔店)','county'=>'','mobile'=>'15771712861','create_time'=>NULL,'update_time'=>NULL,'status'=>NULL,'lng_lat'=>'{\"lng\":\"108.967625\",\"lat\":\"34.220938\"}','extra'=>'a:23:{s:5:"intro";s:0:"";s:7:"service";s:0:"";s:9:"hotSearch";s:0:"";s:6:"notice";s:0:"";s:3:"des";s:0:"";s:12:"surroundings";s:0:"";s:11:"certificate";s:0:"";s:12:"contact_type";s:0:"";s:9:"send_type";s:0:"";s:8:"distance";s:0:"";s:13:"startingPrice";s:0:"";s:12:"shippingDees";s:0:"";s:8:"Lodop_ip";s:0:"";s:4:"USER";s:0:"";s:4:"UKEY";s:0:"";s:2:"SN";s:0:"";s:8:"printNum";s:0:"";s:8:"douradio";s:3:"0.4";s:10:"moneyradio";s:3:"0.4";s:8:"agemoney";s:0:"";s:8:"shareimg";s:50:"202012/11/4c8073dc-70f9-38f8-90e6-ee8409cbc446.jpg";s:10:"myshareimg";s:0:"";s:7:"onecode";s:0:"";}','longitude'=>'108.967625','latitude'=>'34.220938']);
        $this->insert('{{%diandi_store}}',['store_id'=>'55','category_id'=>'39','category_pid'=>'35','name'=>'美年大健康体检中心 (金花北路店)','logo'=>'202103/11/e8c55d2b-482d-3d2d-a368-7fb9fab2026c.png','bloc_id'=>'11','province'=>'2898','city'=>'2899','address'=>'陕西省西安市碑林区互助路2号建国饭店东楼 美年大健康(金花北路店)','county'=>'2901','mobile'=>'陕西省西安市碑林区互助','create_time'=>NULL,'update_time'=>NULL,'status'=>'1','lng_lat'=>'{\"lng\":\"109.002757\",\"lat\":\"34.264759\"}','extra'=>'a:23:{s:5:"intro";s:0:"";s:7:"service";s:0:"";s:9:"hotSearch";s:0:"";s:6:"notice";s:0:"";s:3:"des";s:0:"";s:12:"surroundings";s:0:"";s:11:"certificate";s:0:"";s:12:"contact_type";s:0:"";s:9:"send_type";s:0:"";s:8:"distance";s:0:"";s:13:"startingPrice";s:0:"";s:12:"shippingDees";s:0:"";s:8:"Lodop_ip";s:0:"";s:4:"USER";s:0:"";s:4:"UKEY";s:0:"";s:2:"SN";s:0:"";s:8:"printNum";s:0:"";s:8:"douradio";s:3:"0.4";s:10:"moneyradio";s:3:"0.4";s:8:"agemoney";s:0:"";s:8:"shareimg";s:50:"202012/11/9fea0120-5b85-37fa-ba32-5b45ea4ec377.jpg";s:10:"myshareimg";s:0:"";s:7:"onecode";s:0:"";}','longitude'=>'109.002757','latitude'=>'34.264759']);
        $this->insert('{{%diandi_store}}',['store_id'=>'56','category_id'=>'39','category_pid'=>'35','name'=>'美年大健康体检中心（高新分院）','logo'=>'202103/11/1fb26e25-2437-335e-bee5-ebbe299de904.png','bloc_id'=>'11','province'=>'2898','city'=>'2899','address'=>'陕西省西安市雁塔区二环南路西段154号易和蓝钻1号楼2层 美年大健康体检西安高新分院','county'=>'','mobile'=>'15771712861','create_time'=>NULL,'update_time'=>NULL,'status'=>'1','lng_lat'=>'{\"lng\":\"108.917961\",\"lat\":\"34.243562\"}','extra'=>'a:23:{s:5:"intro";s:0:"";s:7:"service";s:0:"";s:9:"hotSearch";s:0:"";s:6:"notice";s:0:"";s:3:"des";s:0:"";s:12:"surroundings";s:0:"";s:11:"certificate";s:0:"";s:12:"contact_type";s:0:"";s:9:"send_type";s:0:"";s:8:"distance";s:0:"";s:13:"startingPrice";s:0:"";s:12:"shippingDees";s:0:"";s:8:"Lodop_ip";s:0:"";s:4:"USER";s:0:"";s:4:"UKEY";s:0:"";s:2:"SN";s:0:"";s:8:"printNum";s:0:"";s:8:"douradio";s:3:"0.4";s:10:"moneyradio";s:3:"0.4";s:8:"agemoney";s:0:"";s:8:"shareimg";s:50:"202012/11/bd8629e1-6be5-3d68-8e65-404482fa1f30.jpg";s:10:"myshareimg";s:0:"";s:7:"onecode";s:0:"";}','longitude'=>'108.917961','latitude'=>'34.243562']);
        $this->insert('{{%diandi_store}}',['store_id'=>'57','category_id'=>'15','category_pid'=>'5','name'=>'陕西省大荔县日月生果蔬农民专业合作社','logo'=>'202012/08/544687f1-c1ee-38d3-ab80-cfdbc3245854.jpg','bloc_id'=>'8','province'=>'2898','city'=>'2946','address'=>'陕西省渭南市大荔县城关镇黄河国际2号楼一单元3003','county'=>'2950','mobile'=>'17609238341','create_time'=>NULL,'update_time'=>NULL,'status'=>'1','lng_lat'=>'{\"lng\":\"109.959755\",\"lat\":\"34.803392\"}','extra'=>'a:23:{s:5:"intro";s:85:"产地直供:大荔冬枣、洛川苹果、富平柿饼、临潼石榴、蒲城酥梨";s:7:"service";s:0:"";s:9:"hotSearch";s:42:"水果，冬枣，柿饼，石榴，酥梨";s:6:"notice";s:0:"";s:3:"des";s:0:"";s:12:"surroundings";a:1:{i:0;s:50:"202012/08/b402f8e3-a11b-3fe1-8bcd-f924027793c5.jpg";}s:11:"certificate";a:1:{i:0;s:50:"202012/08/17864ed3-731d-3549-ad13-eb2e10e75162.jpg";}s:12:"contact_type";s:0:"";s:9:"send_type";s:0:"";s:8:"distance";s:0:"";s:13:"startingPrice";s:0:"";s:12:"shippingDees";s:0:"";s:8:"Lodop_ip";s:0:"";s:4:"USER";s:0:"";s:4:"UKEY";s:0:"";s:2:"SN";s:0:"";s:8:"printNum";s:0:"";s:8:"douradio";s:3:"0.4";s:10:"moneyradio";s:3:"0.4";s:8:"agemoney";s:0:"";s:8:"shareimg";s:50:"202012/11/c9fff077-7978-3a34-822a-5986b821291f.jpg";s:10:"myshareimg";s:0:"";s:7:"onecode";s:0:"";}','longitude'=>'109.959755','latitude'=>'34.803392']);
        $this->insert('{{%diandi_store}}',['store_id'=>'58','category_id'=>'42','category_pid'=>'35','name'=>'护眼馆','logo'=>'202012/08/69919afb-c0a8-363d-85e4-98559392fee5.jpg','bloc_id'=>'8','province'=>'2898','city'=>'2899','address'=>'陕西省西安市长安区航天城神州一路茗景园东门','county'=>'2908','mobile'=>'','create_time'=>NULL,'update_time'=>NULL,'status'=>'1','lng_lat'=>'{\"lng\":\"108.956985\",\"lat\":\"34.173766\"}','extra'=>'a:23:{s:5:"intro";s:0:"";s:7:"service";s:21:"护眼全系列产品";s:9:"hotSearch";s:51:"护眼，白内障，眼干，青光眼，红血丝";s:6:"notice";s:0:"";s:3:"des";s:0:"";s:12:"surroundings";a:1:{i:0;s:50:"202012/08/8e7065df-8d46-3cfc-80d7-82ad59c27540.jpg";}s:11:"certificate";a:1:{i:0;s:50:"202012/08/460fa225-5a07-3342-aa54-3ceddca000ed.jpg";}s:12:"contact_type";s:0:"";s:9:"send_type";s:0:"";s:8:"distance";s:0:"";s:13:"startingPrice";s:0:"";s:12:"shippingDees";s:0:"";s:8:"Lodop_ip";s:0:"";s:4:"USER";s:0:"";s:4:"UKEY";s:0:"";s:2:"SN";s:0:"";s:8:"printNum";s:0:"";s:8:"douradio";s:3:"0.4";s:10:"moneyradio";s:3:"0.4";s:8:"agemoney";s:0:"";s:8:"shareimg";s:50:"202012/11/c654a42d-c594-3277-bb6c-b2c05afee1da.jpg";s:10:"myshareimg";s:0:"";s:7:"onecode";s:0:"";}','longitude'=>'108.956985','latitude'=>'34.173766']);
        $this->insert('{{%diandi_store}}',['store_id'=>'59','category_id'=>'7','category_pid'=>'5','name'=>'凤香老烧坊商行','logo'=>'202012/10/19ab45cb-6764-3f38-998b-ab84197ec30e.jpg','bloc_id'=>'8','province'=>'2898','city'=>'2918','address'=>'陕西省宝鸡市凤翔县柳林镇凤香老烧坊商行','county'=>'2922','mobile'=>'13008419791','create_time'=>NULL,'update_time'=>NULL,'status'=>'1','lng_lat'=>'{\"lng\":\"107.319253\",\"lat\":\"34.554969\"}','extra'=>'a:23:{s:5:"intro";s:24:"食品，香烟，酒类";s:7:"service";s:15:"食品，酒类";s:9:"hotSearch";s:15:"食品，酒类";s:6:"notice";s:0:"";s:3:"des";s:0:"";s:12:"surroundings";a:1:{i:0;s:50:"202012/10/f19d1df3-502d-3acd-991d-f65325960c98.jpg";}s:11:"certificate";a:1:{i:0;s:50:"202012/10/43bd0402-dca4-34b3-89c1-69257c5959d4.jpg";}s:12:"contact_type";s:0:"";s:9:"send_type";a:1:{i:0;s:1:"1";}s:8:"distance";s:0:"";s:13:"startingPrice";s:0:"";s:12:"shippingDees";s:0:"";s:8:"Lodop_ip";s:0:"";s:4:"USER";s:0:"";s:4:"UKEY";s:0:"";s:2:"SN";s:0:"";s:8:"printNum";s:0:"";s:8:"douradio";s:3:"0.4";s:10:"moneyradio";s:3:"0.4";s:8:"agemoney";s:0:"";s:8:"shareimg";s:0:"";s:10:"myshareimg";s:0:"";s:7:"onecode";s:0:"";}','longitude'=>'107.319253','latitude'=>'34.554969']);
        $this->insert('{{%diandi_store}}',['store_id'=>'61','category_id'=>'16','category_pid'=>'5','name'=>'客服小店','logo'=>'202012/14/f42fc67e-b09d-3b8c-9969-279311b91019.jpg','bloc_id'=>'8','province'=>'2898','city'=>'2899','address'=>'陕西省西安市雁塔区永松路116A名人居','county'=>'2905','mobile'=>'','create_time'=>NULL,'update_time'=>NULL,'status'=>'1','lng_lat'=>'{\"lng\":\"108.93104\",\"lat\":\"34.235521\"}','extra'=>'a:23:{s:5:"intro";s:0:"";s:7:"service";s:0:"";s:9:"hotSearch";s:0:"";s:6:"notice";s:0:"";s:3:"des";s:0:"";s:12:"surroundings";s:0:"";s:11:"certificate";s:0:"";s:12:"contact_type";s:0:"";s:9:"send_type";a:1:{i:0;s:1:"0";}s:8:"distance";s:0:"";s:13:"startingPrice";s:0:"";s:12:"shippingDees";s:0:"";s:8:"Lodop_ip";s:0:"";s:4:"USER";s:0:"";s:4:"UKEY";s:0:"";s:2:"SN";s:0:"";s:8:"printNum";s:0:"";s:8:"douradio";s:3:"0.4";s:10:"moneyradio";s:3:"0.4";s:8:"agemoney";s:0:"";s:8:"shareimg";s:0:"";s:10:"myshareimg";s:0:"";s:7:"onecode";s:0:"";}','longitude'=>'108.93104','latitude'=>'34.235521']);
        $this->insert('{{%diandi_store}}',['store_id'=>'62','category_id'=>'6','category_pid'=>'5','name'=>'标签测试','logo'=>'202101/17/4aaebee1-3982-37c1-b3a4-225c41c8a434.png','bloc_id'=>'8','province'=>'19','city'=>'20','address'=>'具体','county'=>'22','mobile'=>'15829773213','create_time'=>NULL,'update_time'=>NULL,'status'=>'1','lng_lat'=>'{\"lng\":\"108.931497\",\"lat\":\"34.261245\"}','extra'=>'N;','longitude'=>'108.931497','latitude'=>'34.261245']);
        $this->insert('{{%diandi_store}}',['store_id'=>'63','category_id'=>'7','category_pid'=>'5','name'=>'测试标签','logo'=>'202011/10/73451b47-7b23-3a66-af6a-b4d27513b564.png','bloc_id'=>'8','province'=>'1','city'=>'2','address'=>'详细地址','county'=>'4','mobile'=>'17778984690','create_time'=>NULL,'update_time'=>NULL,'status'=>'1','lng_lat'=>'{\"lng\":\"108.883877\",\"lat\":\"34.275631\"}','extra'=>'N;','longitude'=>'108.883877','latitude'=>'34.275631']);
        $this->insert('{{%diandi_store}}',['store_id'=>'64','category_id'=>'43','category_pid'=>'32','name'=>'都唻团','logo'=>'202101/17/d6c606b5-c74d-3702-88ba-9ed8ccafd18b.png','bloc_id'=>'0','province'=>'351','city'=>'','address'=>'详细地址','county'=>'','mobile'=>'17778984690','create_time'=>NULL,'update_time'=>NULL,'status'=>'2','lng_lat'=>'{\"lng\":\"108.953228\",\"lat\":\"34.266552\"}','extra'=>'N;','longitude'=>'108.953228','latitude'=>'34.266552']);
        $this->insert('{{%diandi_store}}',['store_id'=>'65','category_id'=>'45','category_pid'=>'32','name'=>'测试标签','logo'=>'202011/10/73451b47-7b23-3a66-af6a-b4d27513b564.png','bloc_id'=>'8','province'=>'37','city'=>'38','address'=>'详细地址','county'=>'42','mobile'=>'17778984690','create_time'=>NULL,'update_time'=>NULL,'status'=>'2','lng_lat'=>'{\"lng\":\"109.028416\",\"lat\":\"34.277617\"}','extra'=>'N;','longitude'=>'109.028416','latitude'=>'34.277617']);
        $this->insert('{{%diandi_store}}',['store_id'=>'66','category_id'=>'48','category_pid'=>'47','name'=>'演示商户','logo'=>'202103/25/d8bae847-49d0-3607-92e1-c4cef915c0bb.jpg','bloc_id'=>'12','province'=>'1','city'=>'2','address'=>'15484','county'=>'7','mobile'=>'17778984690','create_time'=>NULL,'update_time'=>NULL,'status'=>'1','lng_lat'=>'{\"lng\":\"108.696251\",\"lat\":\"34.35262\"}','extra'=>'N;','longitude'=>'108.696251','latitude'=>'34.35262']);
        
        /* 设置外键约束 */
        $this->execute('SET foreign_key_checks = 1;');
    }

    public function down()
    {
        $this->execute('SET foreign_key_checks = 0');
        /* 删除表 */
        $this->dropTable('{{%diandi_store}}');
        $this->execute('SET foreign_key_checks = 1;');
    }
}

